package org.idansof.otp;

import java.util.Locale;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;


@DatabaseTable (tableName = "otp_provider")
public class OTPProvider {

	@DatabaseField (generatedId  = true)
	private Integer id;
	@DatabaseField
	private String host;
	@DatabaseField
	private String geodecoderUri;
	@DatabaseField
	private String planUri;
	@DatabaseField
	private String title;
	@DatabaseField
	private String description;
	@DatabaseField
	private String locale;
	@DatabaseField
	private double bounaryTop;
	@DatabaseField
	private double bounaryBottom;
	@DatabaseField
	private double bounaryRight;
	@DatabaseField
	private double bounaryLeft;
	
	public OTPProvider() {
		// TODO Auto-generated constructor stub
	}
	
	public OTPProvider(String host, String geodecoderUri,String planUri, String title, String description,
			String locale, double bounaryTop, double bounaryBottom,double bounaryLeft,double bounaryRight) {
		super();
		this.host = host;
		this.geodecoderUri = geodecoderUri;
		this.planUri = planUri;
		this.title = title;
		this.description = description;
		this.locale = locale;
		this.bounaryTop = bounaryTop;
		this.bounaryBottom = bounaryBottom;
		this.bounaryLeft = bounaryLeft;
		this.bounaryRight = bounaryRight;
	}
	
	public int getId() {
		return id;
	}
	
	/**
	 * @return the host
	 */
	public String getHost() {
		return host;
	}
	
	public String getGeodecoderUri() {
		return geodecoderUri;
	}
	
	public String getPlanUri() {
		return planUri;
	}
	
	/**
	 * @return the title
	 */
	public String getTitle() {
		return title;
	}
	/**
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}
	/**
	 * @return the locale
	 */
	public String getLocale() {
		return locale;
	}
	
	public Locale getLocaleObject()
	{
		String[] splittedLocale = locale.split("-");
		return new Locale(splittedLocale[0],splittedLocale[1]);
	}

	/**
	 * @return the bounaryTop
	 */
	public double getBounaryTop() {
		return bounaryTop;
	}

	/**
	 * @return the bounaryBottom
	 */
	public double getBounaryBottom() {
		return bounaryBottom;
	}

	/**
	 * @return the bounaryRight
	 */
	public double getBounaryRight() {
		return bounaryRight;
	}

	/**
	 * @return the bounaryLeft
	 */
	public double getBounaryLeft() {
		return bounaryLeft;
	}
	
	
	
}
